package com.kede.app.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @description /
* @author Pr.li
* @date 2023-08-19
**/
@Entity
@Data
@IdClass(OperatUser.class)
@Table(name="t_operat_user")
public class OperatUser implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 
    */
    @ApiModelProperty(value = "userId")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`user_id`")
    private Integer userId;
    /**
    * 
    */
    @ApiModelProperty(value = "senceNo")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`sence_no`")
    private String senceNo;
    /**
    * 
    */
    @ApiModelProperty(value = "userPhone")
    @Column(name = "`user_phone`")
    private String userPhone;
    /**
    * 
    */
    @ApiModelProperty(value = "adcode")
    @Column(name = "`adcode`")
    private Integer adcode;
    /**
    * 
    */
    @ApiModelProperty(value = "createTime")
    @Column(name = "`create_time`")
    private Timestamp createTime;

    public void copy(OperatUser source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
